<template>
  <div>
    <el-table
      :data="findsynchronousRecordingByOneDays"
      title="每日同步记录表"
      style="width: 100%"
    >
      <el-table-column
        label="姓名"
        width="130"
      >
        <template slot-scope="scope">
          <i class="el-icon-star-off" />
          <span style="margin-left: 10px">{{ scope.row.student_name }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="身份证号"
        width="220"
      >
        <template slot-scope="scope">
          <el-popover trigger="hover" placement="top">
            <p>姓名: {{ scope.row.student_name }}</p>
            <p>身份证号: {{ scope.row.id_card }}</p>
            <div slot="reference" class="name-wrapper">
              <el-tag size="medium">{{ scope.row.id_card }}</el-tag>
            </div>
          </el-popover>
        </template>
      </el-table-column>
      <el-table-column
        label="同步类型"
        width="180"
      >
        <template slot-scope="scope">
          <i class="el-icon-star-off" />
          <span style="margin-left: 10px">{{ scope.row.synchronization_type }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="信息对比"
        width="180"
      >
        <template slot-scope="scope">
          <el-popover trigger="hover" placement="top">
            <p>原信息: {{ scope.row.old_information }}</p>
            <p>新信息: {{ scope.row.new_information }}</p>
            <div slot="reference" class="name-wrapper">
              <el-tag size="medium">查看</el-tag>
            </div>
          </el-popover>
        </template>
      </el-table-column>
      <el-table-column
        label="同步时间"
        width="180"
      >
        <template slot-scope="scope">
          <i class="el-icon-time" />
          <span style="margin-left: 10px">{{ scope.row.synchronization_time }}</span>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="totals>0" :total="totals" :page.sync="pagination.num" :limit.sync="pagination.size" @pagination="findsynchronousRecordingByOneDay" />
  </div>
</template>

<script>
import Pagination from '@/components/Pagination'
export default {
  components: { Pagination },
  props: {
    findsynchronousRecordingByOneDays: {},
    totals: {
      type: Number,
      default: 0
    },
    synchronization_time: {
      type: String,
      default: ''
    },
    data_sources: {
      type: String,
      default: ''
    },
    synchronization_type: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      pagination: {
        size: 15,
        num: 1
      },
      total: 0
    }
  },
  methods: {
    findsynchronousRecordingByOneDay(index, row) {
      var params1 = {}
      params1.pageSize = this.pagination.size
      params1.pageNum = this.pagination.num
      params1.synchronousRecordingByTime = this.synchronization_time
      params1.data_sources = this.data_sources
      params1.synchronization_type = this.synchronization_type
      this.titleTime = this.synchronization_time
      this.$get('copyData/findsynchronousRecordingByOneDay', {
        ...params1
      }).then((r) => {
        const data = r.data.data
        this.findsynchronousRecordingByOneDays = data
        this.loading = true
      })
      this.dialogTableVisible = true
    }
  }
}
</script>

<style>
.titles {
    border-radius: 5px;
    min-height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
</style>

